<?php
/**
 *
 * 主模型
 *
 * @author		Tata <windzb@qq.com>
 */

class Model {

	public $c;
	public $dbh;

	/*其他*/
	public $is_admin = false;

	/*卖家*/
	public $tb_uid;
	public $tb_nick;
	public $top_session;

	/*
    * ------------------------------------------------------
    *  构建函数 - 取得一些常用变量
    * ------------------------------------------------------
    */
	public function __construct()
	{
		global $context;

		//初始化数据库链接
		$this->dbh = new DB();

	}

	/*
    * ------------------------------------------------------
    *  初始化TOP
    * ------------------------------------------------------
    */
	public function init_top()
	{
		include_once(LIBS_PATH."/api/TopSdk.php");
		$httpdns = new HttpdnsGetRequest;
		//初始化TOPSDK
		$this->c = new ClusterTopClient();
		$this->c->appkey = appKey;
		$this->c->secretKey = appSecret;

		if($_SESSION && $_SESSION['id']) $this->id = $_SESSION['id'];
		if($_SESSION && $_SESSION['tb_uid']) $this->tb_uid = $_SESSION['tb_uid'];
		if($_SESSION && $_SESSION['tb_nick']) $this->tb_nick = $_SESSION['tb_nick'];
		if($_SESSION && $_SESSION['top_session']) $this->top_session = $_SESSION['top_session'];
	}


}

/* End of file Model.php */
/* Location: ./core/Model.php */